<template>
  <div class="child1">
    <h1>子组件1</h1>
    <div>玩具: {{ toy }}</div>
    <button @click="emitter.emit('send-toy', toy)">玩具给子组件2</button>
  </div>
</template>

<script setup lang="ts" name="Child1">
import emitter from '@/utils/emitter';
import { ref } from 'vue';


const toy = ref('奥特曼');

</script>